/** 全局图片请求地址 */
export const imgBaseURL = 'https://youxiaoku.oss-cn-beijing.aliyuncs.com/Small_program/applet/'

/**
 * 简化的消息提示
 * @param {String} title 内容
 * @param {Number} duration 显示时间
 * @example showToast('标题', 2000)
 */
export function showToast(title: string, duration: number = 2000) {
  return new Promise((resolve, reject) => {
    uni.showToast({
      title: title || '',
      duration: duration,
      icon: 'none'
    })
    setTimeout(() => resolve(''), duration || 2000)
  })
}
